package com.example.list.four_basic_component;

import android.app.IntentService;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.app.JobIntentService;

public class DinnerService extends JobIntentService {


    @Override
    public void onCreate() {
        super.onCreate();
        Log.i("dinnerservice","-------onCreate-------");
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        String test = intent.getStringExtra("test");
        Log.i("dinnerservice","-------test-------" + test);
        Log.i("dinnerservice","-------flags-------" + flags);
        Log.i("dinnerservice","-------startId-------" + startId);
        Log.i("dinnerservice","-------onStartCommand-------");

        return super.onStartCommand(intent, flags, startId);
    }

    /**
     * 服务销毁时的回调
     */
    @Override
    public void onDestroy() {

        Log.i("dinnerservice","-------onDestroy-------");
        super.onDestroy();
    }

    @Override
    protected void onHandleWork(@NonNull Intent intent) {

    }

}
